home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / colors.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  3KB  |  83 lines

  1. #ifndef __COLORS_H_    // System constants for colors and proportions
  2. #define __COLORS_H_    // of diffferent screen types
  3.  
  4. #include <stdio.h>
  5. #include "mouse.h"
  6.  
  7. #include "global.h"
  8. #include "graphpp.h"
  9. #include "simple.h"
  10.  
  11. enum { MEDIUM_ICON = 1, SMALL_ICON, LARGE_ICON };  // Icon types
  12.  
  13. struct Colors
  14.     {
  15.     uchar  HILITE_COLOR,     // Hilite frame when window becomes active
  16.            BAK_COLOR,        // Window background
  17.            FILL_COLOR,       // USED with BAK_COLOR if PATTERN != SOLID_FILL
  18.        ATTR_COLOR,       // For output to window
  19.        SHADOW_COLOR,     // Shadow color
  20.            HDR_BAK_COLOR,    // Header background
  21.            HDR_ATTR_COLOR,   // Header text color
  22.            MARK_COLOR,       // Text block hilite color
  23.            MARK_BAK_COLOR,   // Text block background hilite color
  24.            BORDER_COLOR1,    // Border colors. For nice-look border output
  25.        BORDER_COLOR2,    // we need at least 3 colors.
  26.        BORDER_COLOR3,
  27.            PATTERN;          // Fill style
  28.     };
  29.  
  30. struct ColorSet
  31.     {
  32.     int color_set_number;  // Number of current color set
  33.     Colors colors;
  34.  
  35.     ColorSet();
  36.     void loadColorSet(int number = 0);         // load from "colors.set"
  37.     };
  38. extern ColorSet* pColorSet;
  39.  
  40. struct ScreenSet
  41.     {
  42.     uchar cell_height;        // Height of cells of the screen (25 x 80)
  43.     uchar log2cell_width;
  44.     uchar cell_width;         // Width of cells of the screen (25 x 80)
  45.  
  46.     uchar standart_width;         // Char dimentions, not connected with
  47.     uchar standart_height;        // cells. Used as default for screen output.
  48.     uchar sub_interval;
  49.  
  50.     loc ICON_PIXELS_1;     // Type 1 icon size in pixels
  51.     loc ICON_PIXELS_2;     // Type 2 icon size in pixels
  52.     loc ICON_PIXELS_3;     // Type 3 icon size in pixels
  53.  
  54.     loc icon_types[4];     // Array of loc(0, 0), ICON_TEXT_1, 2, 3.
  55.  
  56.     int g_driver;           // BGI driver and mode
  57.     int g_mode;
  58.  
  59.     ScreenSet(int gdriver, int gmode);
  60.     int* get_cells(rect cur_rect);
  61.     };
  62. extern ScreenSet* pScreenSet;
  63. ///////////////////////////////////////
  64.  
  65. /*
  66.       Calculates monitor mode - dependent coordinates, like cell_height,
  67.       log2cell_width (cell_width  = 1 << log2cell_width),
  68.       ICON_Y1, ICON_Y2, ICON_Y3, ICON_X1, ICON_X2, ICON_X3 - size of
  69.       icons of different types (pixels).
  70. */
  71. /////////////////////////
  72. /* This function initializes KNOW-HOW and graphics.
  73.        Arguments: graphics driver and number of color set loaded
  74.            from file COLORS.SET
  75.        Return value: 1 - success, 0 - error.
  76. */
  77. int init_KNOW_HOW(int driver = DETECT, int macros = 0);
  78. ///////////////////////////////////////
  79. // This function call global_remove(), and deletes Screen and Color Sets.
  80. void close_KNOW_HOW();
  81.  
  82. #endif __COLORS_H_
  83.